package com.example.wnn.develop.lambdas;

import cn.hutool.core.date.DateUtil;
import com.example.wnn.utils.EmaileUtils;
import com.example.wnn.utils.MobileUtil;
import org.apache.tomcat.util.buf.StringUtils;

import java.util.*;

public class LambdaLocalTest {



    public static void main(String[] args) {
        long randomNumber = (long) (Math.random() * 10) + 1;
       System.out.println(((long) (Math.random() * 5)));

        boolean f = MobileUtil.checkPhone("19375193040");
        if (f){
            System.out.println("yes");
        }else {
            System.out.println("no");

        }

        String a = "<span style=\"font-size: 16pt;\">《军报每天读》20221119</span><span lang=\"EN-US\" style=\"font-size: 16pt;\"></span>";

        List<String> resultList = new ArrayList<>();
        resultList.add("2121");
        resultList.add("你好");
        resultList.add(0,"0000");
        resultList.add(1,"1111");
        resultList.add(1,"00001");

        System.out.println(StringUtils.join(resultList));

        if ("321321312".matches("\\d+")){
            System.out.println("是正整数---å");
        }

        Calendar cd = Calendar.getInstance();
        cd.setTime(new Date());
        cd.add(Calendar.DATE, 3);
        System.out.println(DateUtil.format(cd.getTime(),"yyyy-MM-dd HH:mm:ss"));


        //2022-09-27 ,removeIf排除集合中元素
        List<LambdaVo> vos = new ArrayList<>();
        vos.addAll( Arrays.asList(new LambdaVo(1,"张三","11"),
                new LambdaVo(2,"张三","22"),new LambdaVo(3,"张三","33")));
        List<Integer> items = Arrays.asList(1,2);
        vos.removeIf(i->items.contains(i.getId()));
        System.out.println("removeIf排除集合中元素 ->"+vos);

    }
}